﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLK.Database.DALs;

namespace QLK.Database.BLLs
{
    public class EmployeeBLL
    {
        private EmployeeDAL dal;

        public EmployeeBLL()
        {
            dal = new EmployeeDAL();
        }

        public List<Employee> EmployeeGetAll()
        {
            return dal.EmployeeGetAll();
        }

        public Employee EmployeeGetByID(int EmpID)
        {
            return dal.EmployeeGetByID(EmpID);
        }

        public bool EmployeeInsert(Employee Emps)
        {
            if (dal.EmployeeCheckDuplicateIDCard(Emps.IDCard))
                return dal.EmployeeInsert(Emps);
            return false;
        }

        public bool EmployeeDeleteByID(int EmpID)
        {
            return dal.EmployeeDeleteByID(EmpID);
        }

        public bool EmployeeUpdate(Employee Emps)
        {
            if (dal.EmployeeCheckDuplicateIDCard(Emps.IDCard))
                return dal.EmployeeUpdate(Emps);
            return false;
        }
    }
}
